\(\int (\frac {\cos (a+b x+c x^2)}{x^2}+\frac {b \sin (a+b x+c x^2)}{x}) \, dx\) [5]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 32, antiderivative size = 111 \[ \int \left (\frac {\cos \left (a+b x+c x^2\right )}{x^2}+\frac {b \sin \left (a+b x+c x^2\right )}{x}\right ) \, dx=-\frac {\cos \left (a+b x+c x^2\right )}{x}-\sqrt {c} \sqrt {2 \pi } \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )-\sqrt {c} \sqrt {2 \pi } \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a-\frac {b^2}{4 c}\right ) \]

[Out]

-cos(c*x^2+b*x+a)/x-cos(a-1/4*b^2/c)*FresnelS(1/2*(2*c*x+b)/c^(1/2)*2^(1/2)/Pi^(1/2))*c^(1/2)*2^(1/2)*Pi^(1/2)
-FresnelC(1/2*(2*c*x+b)/c^(1/2)*2^(1/2)/Pi^(1/2))*sin(a-1/4*b^2/c)*c^(1/2)*2^(1/2)*Pi^(1/2)

Rubi [A] (verified)

Time = 0.14 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3547, 3528, 3432, 3433} \[ \int \left (\frac {\cos \left (a+b x+c x^2\right )}{x^2}+\frac {b \sin \left (a+b x+c x^2\right )}{x}\right ) \, dx=-\sqrt {2 \pi } \sqrt {c} \sin \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )-\sqrt {2 \pi } \sqrt {c} \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )-\frac {\cos \left (a+b x+c x^2\right )}{x} \]

[In]

Int[Cos[a + b*x + c*x^2]/x^2 + (b*Sin[a + b*x + c*x^2])/x,x]

[Out]

-(Cos[a + b*x + c*x^2]/x) - Sqrt[c]*Sqrt[2*Pi]*Cos[a - b^2/(4*c)]*FresnelS[(b + 2*c*x)/(Sqrt[c]*Sqrt[2*Pi])] -
 Sqrt[c]*Sqrt[2*Pi]*FresnelC[(b + 2*c*x)/(Sqrt[c]*Sqrt[2*Pi])]*Sin[a - b^2/(4*c)]

Rule 3432

Int[Sin[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]/(f*Rt[d, 2]))*FresnelS[Sqrt[2/Pi]*Rt[d, 2
]*(e + f*x)], x] /; FreeQ[{d, e, f}, x]

Rule 3433

Int[Cos[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]/(f*Rt[d, 2]))*FresnelC[Sqrt[2/Pi]*Rt[d, 2
]*(e + f*x)], x] /; FreeQ[{d, e, f}, x]

Rule 3528

Int[Sin[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[Cos[(b^2 - 4*a*c)/(4*c)], Int[Sin[(b + 2*c*x)^2/
(4*c)], x], x] - Dist[Sin[(b^2 - 4*a*c)/(4*c)], Int[Cos[(b + 2*c*x)^2/(4*c)], x], x] /; FreeQ[{a, b, c}, x] &&
 NeQ[b^2 - 4*a*c, 0]

Rule 3547

Int[Cos[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]*((d_.) + (e_.)*(x_))^(m_), x_Symbol] :> Simp[(d + e*x)^(m + 1)*(Cos
[a + b*x + c*x^2]/(e*(m + 1))), x] + (Dist[(b*e - 2*c*d)/(e^2*(m + 1)), Int[(d + e*x)^(m + 1)*Sin[a + b*x + c*
x^2], x], x] + Dist[2*(c/(e^2*(m + 1))), Int[(d + e*x)^(m + 2)*Sin[a + b*x + c*x^2], x], x]) /; FreeQ[{a, b, c
, d, e}, x] && NeQ[b*e - 2*c*d, 0] && LtQ[m, -1]

Rubi steps \begin{align*} \text {integral}& = b \int \frac {\sin \left (a+b x+c x^2\right )}{x} \, dx+\int \frac {\cos \left (a+b x+c x^2\right )}{x^2} \, dx \\ & = -\frac {\cos \left (a+b x+c x^2\right )}{x}-(2 c) \int \sin \left (a+b x+c x^2\right ) \, dx \\ & = -\frac {\cos \left (a+b x+c x^2\right )}{x}-\left (2 c \cos \left (a-\frac {b^2}{4 c}\right )\right ) \int \sin \left (\frac {(b+2 c x)^2}{4 c}\right ) \, dx-\left (2 c \sin \left (a-\frac {b^2}{4 c}\right )\right ) \int \cos \left (\frac {(b+2 c x)^2}{4 c}\right ) \, dx \\ & = -\frac {\cos \left (a+b x+c x^2\right )}{x}-\sqrt {c} \sqrt {2 \pi } \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )-\sqrt {c} \sqrt {2 \pi } \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a-\frac {b^2}{4 c}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 1.72 (sec) , antiderivative size = 110, normalized size of antiderivative = 0.99 \[ \int \left (\frac {\cos \left (a+b x+c x^2\right )}{x^2}+\frac {b \sin \left (a+b x+c x^2\right )}{x}\right ) \, dx=-\frac {\cos (a+x (b+c x))+\sqrt {c} \sqrt {2 \pi } x \cos \left (a-\frac {b^2}{4 c}\right ) \operatorname {FresnelS}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right )+\sqrt {c} \sqrt {2 \pi } x \operatorname {FresnelC}\left (\frac {b+2 c x}{\sqrt {c} \sqrt {2 \pi }}\right ) \sin \left (a-\frac {b^2}{4 c}\right )}{x} \]

[In]

Integrate[Cos[a + b*x + c*x^2]/x^2 + (b*Sin[a + b*x + c*x^2])/x,x]

[Out]

-((Cos[a + x*(b + c*x)] + Sqrt[c]*Sqrt[2*Pi]*x*Cos[a - b^2/(4*c)]*FresnelS[(b + 2*c*x)/(Sqrt[c]*Sqrt[2*Pi])] +
 Sqrt[c]*Sqrt[2*Pi]*x*FresnelC[(b + 2*c*x)/(Sqrt[c]*Sqrt[2*Pi])]*Sin[a - b^2/(4*c)])/x)

Maple [F]

\[\int \left (\frac {\cos \left (c \,x^{2}+b x +a \right )}{x^{2}}+\frac {b \sin \left (c \,x^{2}+b x +a \right )}{x}\right )d x\]

[In]

int(cos(c*x^2+b*x+a)/x^2+b*sin(c*x^2+b*x+a)/x,x)

[Out]

int(cos(c*x^2+b*x+a)/x^2+b*sin(c*x^2+b*x+a)/x,x)

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.04 \[ \int \left (\frac {\cos \left (a+b x+c x^2\right )}{x^2}+\frac {b \sin \left (a+b x+c x^2\right )}{x}\right ) \, dx=-\frac {\sqrt {2} \pi x \sqrt {\frac {c}{\pi }} \cos \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) \operatorname {S}\left (\frac {\sqrt {2} {\left (2 \, c x + b\right )} \sqrt {\frac {c}{\pi }}}{2 \, c}\right ) + \sqrt {2} \pi x \sqrt {\frac {c}{\pi }} \operatorname {C}\left (\frac {\sqrt {2} {\left (2 \, c x + b\right )} \sqrt {\frac {c}{\pi }}}{2 \, c}\right ) \sin \left (-\frac {b^{2} - 4 \, a c}{4 \, c}\right ) + \cos \left (c x^{2} + b x + a\right )}{x} \]

[In]

integrate(cos(c*x^2+b*x+a)/x^2+b*sin(c*x^2+b*x+a)/x,x, algorithm="fricas")

[Out]

-(sqrt(2)*pi*x*sqrt(c/pi)*cos(-1/4*(b^2 - 4*a*c)/c)*fresnel_sin(1/2*sqrt(2)*(2*c*x + b)*sqrt(c/pi)/c) + sqrt(2
)*pi*x*sqrt(c/pi)*fresnel_cos(1/2*sqrt(2)*(2*c*x + b)*sqrt(c/pi)/c)*sin(-1/4*(b^2 - 4*a*c)/c) + cos(c*x^2 + b*
x + a))/x

Sympy [F]

\[ \int \left (\frac {\cos \left (a+b x+c x^2\right )}{x^2}+\frac {b \sin \left (a+b x+c x^2\right )}{x}\right ) \, dx=\int \frac {b x \sin {\left (a + b x + c x^{2} \right )} + \cos {\left (a + b x + c x^{2} \right )}}{x^{2}}\, dx \]

[In]

integrate(cos(c*x**2+b*x+a)/x**2+b*sin(c*x**2+b*x+a)/x,x)

[Out]

Integral((b*x*sin(a + b*x + c*x**2) + cos(a + b*x + c*x**2))/x**2, x)

Maxima [F]

\[ \int \left (\frac {\cos \left (a+b x+c x^2\right )}{x^2}+\frac {b \sin \left (a+b x+c x^2\right )}{x}\right ) \, dx=\int { \frac {b \sin \left (c x^{2} + b x + a\right )}{x} + \frac {\cos \left (c x^{2} + b x + a\right )}{x^{2}} \,d x } \]

[In]

integrate(cos(c*x^2+b*x+a)/x^2+b*sin(c*x^2+b*x+a)/x,x, algorithm="maxima")

[Out]

integrate(b*sin(c*x^2 + b*x + a)/x + cos(c*x^2 + b*x + a)/x^2, x)

Giac [F]

\[ \int \left (\frac {\cos \left (a+b x+c x^2\right )}{x^2}+\frac {b \sin \left (a+b x+c x^2\right )}{x}\right ) \, dx=\int { \frac {b \sin \left (c x^{2} + b x + a\right )}{x} + \frac {\cos \left (c x^{2} + b x + a\right )}{x^{2}} \,d x } \]

[In]

integrate(cos(c*x^2+b*x+a)/x^2+b*sin(c*x^2+b*x+a)/x,x, algorithm="giac")

[Out]

integrate(b*sin(c*x^2 + b*x + a)/x + cos(c*x^2 + b*x + a)/x^2, x)

Mupad [F(-1)]

Timed out. \[ \int \left (\frac {\cos \left (a+b x+c x^2\right )}{x^2}+\frac {b \sin \left (a+b x+c x^2\right )}{x}\right ) \, dx=\int \frac {\cos \left (c\,x^2+b\,x+a\right )}{x^2}+\frac {b\,\sin \left (c\,x^2+b\,x+a\right )}{x} \,d x \]

[In]

int(cos(a + b*x + c*x^2)/x^2 + (b*sin(a + b*x + c*x^2))/x,x)

[Out]

int(cos(a + b*x + c*x^2)/x^2 + (b*sin(a + b*x + c*x^2))/x, x)